home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / oleo-1_4.lha / oleo-1.4 / input.h < prev    next >
C/C++ Source or Header  |  1993-03-30  |  3KB  |  105 lines

  1. #ifndef INPUTH
  2. #define INPUTH
  3.  
  4. /*    Copyright (C) 1993 Free Software Foundation, Inc.
  5.  
  6. This program is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. This program is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with this software; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19. /*  t. lord    Mon Feb 15 14:11:13 1993    */
  20.  
  21.  
  22.  
  23. /* Display-generic updating logic for the input area. */
  24.  
  25. #ifdef __STDC__
  26. typedef int (*text_measure) (char * str, int len);
  27. #else
  28. typedef int (*text_measure) ();
  29. #endif
  30.  
  31. /* These are for the field REDRAW_NEEDED */
  32. #define NO_REDRAW        -2
  33. #define FULL_REDRAW        -1
  34.  
  35. struct input_view
  36. {
  37.   /* If this is less than 0, see the #defines above.
  38.    * >= 0, this is the index of a character in the 
  39.    * input string.  All characters at that index and 
  40.    * greater need to be redrawn.
  41.    */
  42.   int redraw_needed;
  43.  
  44.   /* These are provided by io-{curses,x11} and tell how to convert
  45.    * strings to widths.
  46.    */
  47.   text_measure prompt_metric;
  48.   text_measure input_metric;
  49.   
  50.   /* If the currently mapped keymap has a prompt, the display of that
  51.    * prompt takes precedence.
  52.    */
  53.   char * keymap_prompt;
  54.   char * expanded_keymap_prompt;
  55.  
  56.   /* This is the width of either the keymap_prompt or the input text
  57.    * prompt, whichever is current (0 if neither is).
  58.    */
  59.  
  60.   int prompt_wid;
  61.   
  62.   /* The parameters below are a cache.  If this flag is true,
  63.    * the cache is known to be wrong.
  64.    */
  65.   int must_fix_input;
  66.  
  67.   struct line * input_area;    /* The text editted in the input area or 0. */
  68.   char * prompt;
  69.   int visibility_begin;        /* Index of first visible char or 0. */
  70.   int visibility_end;        /* Index of last visible char or 0. */
  71.   int input_cursor;        /* Index of the cursor position or 0. */
  72.   int vis_wid;            /* This is the width of the visible text 
  73.                  * with extra space for the cursor, if it 
  74.                  * happens to be past the end of the string.
  75.                  */
  76.  
  77.   /* A command_arg can specify an info buffer which should be displayed 
  78.    * while prompting for that arg.
  79.    */
  80.   struct info_buffer * current_info;
  81.   int info_pos;        /* In the current info, the first vis. line */ 
  82.   int info_redraw_needed;    /* != 0 if redraw needed */
  83. };
  84.  
  85.  
  86. #ifdef __STDC__
  87. extern void iv_fix_input (struct input_view * this_iv);
  88. extern void iv_move_cursor (struct input_view * this_iv);
  89. extern void iv_erase (struct input_view * this_iv, int len);
  90. extern void iv_insert (struct input_view * this_iv, int len);
  91. extern void iv_over (struct input_view * this_iv, int len);
  92.  
  93. #else
  94. extern void iv_fix_input ();
  95. extern void iv_move_cursor ();
  96. extern void iv_erase ();
  97. extern void iv_insert ();
  98. extern void iv_over ();
  99.  
  100. #endif
  101.  
  102. #endif  /* INPUTH */
  103.  
  104.  
  105.